@extends('layouts.app')
<style>
    #d2{
        display: none;
    }
</style>
@section('content')
    <a href="{{url('shop_show')}}">VIP列表</a>
    <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span1">用户</span>
    <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span2">添加</span>
    <div id="d1">
        <table class="layui-table">
            <thead>
            <tr>
                <th>
                    ID
                </th>
                <th>
                    用户ID
                </th>
                <th>
                    用户昵称
                </th>
                <th>
                    到期时间
                </th>
                <th>
                    操作
                </th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($info as $k => $v){?>
            <tr>
                <td>
                    {{$v->id}}
                </td>
                <td>
                    {{$v->uid}}
                </td>
                <td>
                    {{$v->uname}}
                </td>
                <td>
                    {{$v->e_time}}
                </td>
                <td class="td-manage">
                    <a title="编辑" href="{{url('shop_edit')}};" {{--onclick="view_del(this,'1')"--}}
                    style="text-decoration:none">
                        <i class="layui-icon">&#xe640;</i>
                    </a>
                </td>
            </tr>
            <?php } ?>
            </tbody>
        </table>
    </div>
    <div id="d2">
        <form action="{{url('shop_vipadd')}}" method="post">
            {{csrf_field()}}
            <label class="login-title" for="username">用户ID</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="text" name="uid" lay-verify="required" placeholder="请输入ID" autocomplete="off" class="layui-input">
                </div>
            </div>
            <label class="login-title" for="username">到期时间</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="date" name="e_time" lay-verify="required" id="c_time" autocomplete="off" class="layui-input" >
                </div>
            </div>
            <input type="submit" value="添加" class="btn btn-warning pull-right" lay-submit lay-filter="login">
            <span class="btn btn-warning pull-right" lay-submit lay-filter="login"><a href="{{url('shop_show')}}">返回</a></span>
        </form>
    </div>
@endsection
<script src="jquery.js"></script>
<script>
    $(document).on("click","#span2",function(){
        if($("#d2").css("display")=="none"){
            $("#d2").css("display","block");
            $("#d1").css("display","none");
        }else{
            $("#d2").css("display","none");
            $("#d1").css("display","block");
        }
    })
    $(document).on("click","#span1",function(){
        if($("#d1").css("display")=="none"){
            $("#d1").css("display","block");
            $("#d2").css("display","none");
        }else{
            $("#d1").css("display","none");
            $("#d2").css("display","block");
        }
    })
</script>